import request from '@/utils/request'

// 获取部门列表数据
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'

  })
}

// 获取部门负责人
export function getDepartmentSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

// 新增子部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取部门详情
export function getDepartmentDetail(id) {
  return request({
    url: '/company/department/' + id,
    method: 'get'
  })
}

// 编辑部门详情
export function editDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门详情
export function deleteDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
